const path = require('path')

module.exports = {
  webpack: (config, options, webpack) => {
    config.entry.main = path.resolve(__dirname, 'build', 'index.js')
    // config.entry.main = path.resolve(__dirname, 'server', 'index.js')
    // config.output.path = path.resolve(__dirname, 'dist', 'server')
    // config.resolve.alias = {
    //   '~': path.resolve(__dirname, 'server'),
    //   '~/middlewares': path.resolve(__dirname, 'server', 'middlewares'),
    //   '~/config': path.resolve(__dirname, 'server', 'config'),
    //   '~/routes': path.resolve(__dirname, 'server', 'routes'),
    //   '~/decorator': path.resolve(__dirname, 'server', 'decorator'),
    // }
    config.module.unknownContextCritical = false
    return config
  }
}
